package org.bigk.invoices.taglibs;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.commons.lang.StringUtils;


public class FormTableOpenTag extends TagSupport {

	private static final long serialVersionUID = 6134287328009943136L;

	private String cssClass;
	
	@Override
	public int doStartTag() throws JspException {
		
        try {
        	if (StringUtils.isEmpty(cssClass)) {
        		pageContext.getOut().write("<table>");
        	} else {
        		pageContext.getOut().write("<table class=\"" + cssClass + "\">");
        	}
        	
        } catch (IOException ioe) {
            throw new JspException(ioe.getMessage());
        }
        
        return EVAL_BODY_INCLUDE;
	}

	public String getCssClass() {
		return cssClass;
	}

	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}

	
}
